package com.tal.pad.orc.base;

import com.tal.bcc.pad.cloud.thread.ThreadPoolManager;
import com.tal.bcc.pad.cloud.utils.TextUtils;
import com.tal.pad.orc.base.net.ImageUtils;
import com.tal.pad.orc.base.net.OCRUtils;
import com.tal.pad.orc.base.utils.LogUtils;

import java.io.File;

public class Main {


    /**
     * 2024-11-20 14:55:42 level:INFO main: /Users/tal/Downloads/stockstools.zip
     * 2024-11-20 14:58:51 level:INFO main: /Users/tal/Downloads/xpad1_udpate_sns.xlsx
     * 2024-11-20 14:58:51 level:INFO main: /Users/tal/Downloads/xpad1_update_sn.xlsx
     * 2024-11-20 14:58:51 level:INFO main: /Users/tal/Downloads/xpad2log.zip
     * @param args  文件路径
     */
    public static void main(String[] args) {


        ImageUtils imageUtils = new ImageUtils();
//        imageUtils.uploadImgToOss("/Volumes/wsdisk/cursorws/WeChatProjects/miniprogram-1/assert/imgs/shuidao.jpg",false);
//        imageUtils.uploadImgToOss("./light1_new.jpg",false);
//        imageUtils.uploadImgToOss("./light1_longnews.mp4",false);
        imageUtils.uploadImgToOss("./light2.mp4",false);
//        imageUtils.uploadImgToOss("./sanjie_beiliang.tn6.zip",false);
//        imageUtils.uploadImgToOss("./yanhua.mp3",false);
//        imageUtils.uploadImgToOss("/Users/tal/Downloads/splashbg/splash1.png",false);
//        imageUtils.uploadImgToOss("/Users/tal/Downloads/mzt.ttf",true);
//        imageUtils.uploadImgToOss("/Users/tal/Downloads/mvimg_20240718_screenshoot_103658.png",true);


//
//
//
//        String logFilePath = "/Volumes/wsdisk/javaws/JavaBaseTest/";
//        if(args.length>0){
//            if(!TextUtils.isEmpty( args[0])){
//                File file = new File(args[0]);
//                if(file.exists()&&file.isFile()){
//                    logFilePath= file.getParentFile().getPath();
//                }
//            }
//        }
//        LogUtils logUtils = new LogUtils(logFilePath);
//        LogUtils.setLogUtils(logUtils);
//        ImageUtils imageUtils = new ImageUtils();
//        imageUtils.uploadImgToOss(arg,true);
//        for (String arg : args) {
//            logUtils.info("main", "path: "+ arg);
//            if(filterPath(arg)) {
//                imageUtils.uploadImgToOss(arg,true);
//            }
//        }
        ThreadPoolManager.getInstance().shutDown();
//        for(int i =0 ;i<100; i++){
////            logUtils.info("main","hello ");
//            logUtils.w("main","hello warning ");
//        }
//        imageUtils.uploadImgToOss("/Volumes/wsdisk/javaws/JavaBaseTest/MVIMG_20240718_103659.jpeg",true);

    }

    private static boolean filterPath(String arg) {
        if(arg.endsWith("jpg") || arg.endsWith("jpeg") || arg.endsWith("png") || arg.endsWith("gif") || arg.endsWith("bmp")|| arg.endsWith("tif") || arg.endsWith("tiff")|| arg.endsWith("tif")){
            return new File(arg).isFile() && new File(arg).exists();
        }
        return false;
    }

}
